package com.hsteach.service.calendar;

import java.util.List;

import com.hsteach.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hsteach.dao.mapper.calendar.CalendarDayMapper;
import com.hsteach.dao.domain.calendar.CalendarDay;

/**
 * 周行事历自定义单天Service业务层处理
 * 
 * @author fanxquer
 * @date 2023-11-28
 */
@Service
public class CalendarDayService
{
    @Autowired
    private CalendarDayMapper calendarDayMapper;

    /**
     * 查询周行事历自定义单天
     * 
     * @param id 周行事历自定义单天主键
     * @return 周行事历自定义单天
     */
    public CalendarDay selectCalendarDayById(Long id)
    {
        return calendarDayMapper.selectCalendarDayById(id);
    }

    /**
     * 查询周行事历自定义单天列表
     * 
     * @param calendarDay 周行事历自定义单天
     * @return 周行事历自定义单天
     */
    public List<CalendarDay> selectCalendarDayList(CalendarDay calendarDay)
    {
        return calendarDayMapper.selectCalendarDayList(calendarDay);
    }

    /**
     * 新增周行事历自定义单天
     * 
     * @param calendarDay 周行事历自定义单天
     * @return 结果
     */
    public int insertCalendarDay(CalendarDay calendarDay)
    {
        calendarDay.setCreateTime(DateUtils.getNowDate());
        return calendarDayMapper.insertCalendarDay(calendarDay);
    }

    /**
     * 修改周行事历自定义单天
     * 
     * @param calendarDay 周行事历自定义单天
     * @return 结果
     */
    public int updateCalendarDay(CalendarDay calendarDay)
    {
        calendarDay.setUpdateTime(DateUtils.getNowDate());
        return calendarDayMapper.updateCalendarDay(calendarDay);
    }

    /**
     * 批量删除周行事历自定义单天
     * 
     * @param ids 需要删除的周行事历自定义单天主键
     * @return 结果
     */
    public int deleteCalendarDayByIds(Long[] ids)
    {
        return calendarDayMapper.deleteCalendarDayByIds(ids);
    }

    /**
     * 删除周行事历自定义单天信息
     * 
     * @param id 周行事历自定义单天主键
     * @return 结果
     */
    public int deleteCalendarDayById(Long id)
    {
        return calendarDayMapper.deleteCalendarDayById(id);
    }
}
